package com.zhoushihao.class0806;

import java.util.Scanner;

public class StockFluctuations {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int [] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        int max = 0;
        for (int i = 0; i < n-1; i++) {
            max = Math.max(max,Math.abs(arr[i+1]-arr[i]));
        }
        System.out.println(max);
    }
}
